package com.member.shop.service.impl;

import java.util.Arrays;
import java.util.List;

import com.member.common.utils.DateUtils;

import javax.annotation.Resource;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.member.shop.mapper.SysBizActivityUserMapper;
import com.member.shop.domain.SysBizActivityUser;
import com.member.shop.service.ISysBizActivityUserService;

/**
 * 参与活动用户Service业务层处理
 *
 * @author lixinchen
 * @date 2024-11-09
 */
@Service
public class SysBizActivityUserServiceImpl extends ServiceImpl<SysBizActivityUserMapper, SysBizActivityUser> implements ISysBizActivityUserService {
    @Resource
    private SysBizActivityUserMapper sysBizActivityUserMapper;

    /**
     * 查询参与活动用户
     *
     * @param id 参与活动用户主键
     * @return 参与活动用户
     */
    @Override
    public SysBizActivityUser selectSysBizActivityUserById(Long id) {
        return sysBizActivityUserMapper.selectById(id);
    }

    /**
     * 查询参与活动用户列表
     *
     * @param queryWrapper 参与活动用户
     * @return 参与活动用户
     */
    @Override
    public List<SysBizActivityUser> selectSysBizActivityUserList(LambdaQueryWrapper<SysBizActivityUser> queryWrapper) {
        return sysBizActivityUserMapper.selectList(queryWrapper);
    }

    @Override
    public List<SysBizActivityUser> selectSysBizActivityUserList(SysBizActivityUser sysBizActivityUser) {
        return sysBizActivityUserMapper.selectSysBizActivityUserList(sysBizActivityUser);
    }

    /**
     * 新增参与活动用户
     *
     * @param sysBizActivityUser 参与活动用户
     * @return 结果
     */
    @Override
    public int insertSysBizActivityUser(SysBizActivityUser sysBizActivityUser) {
        sysBizActivityUser.setCreateTime(DateUtils.getNowDate());
        return sysBizActivityUserMapper.insert(sysBizActivityUser);
    }

    /**
     * 修改参与活动用户
     *
     * @param sysBizActivityUser 参与活动用户
     * @return 结果
     */
    @Override
    public int updateSysBizActivityUser(SysBizActivityUser sysBizActivityUser) {
        sysBizActivityUser.setUpdateTime(DateUtils.getNowDate());
        return sysBizActivityUserMapper.updateById(sysBizActivityUser);
    }

    /**
     * 批量删除参与活动用户
     *
     * @param ids 需要删除的参与活动用户主键
     * @return 结果
     */
    @Override
    public int deleteSysBizActivityUserByIds(Long[] ids) {
        return sysBizActivityUserMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除参与活动用户信息
     *
     * @param id 参与活动用户主键
     * @return 结果
     */
    @Override
    public int deleteSysBizActivityUserById(Long id) {
        return sysBizActivityUserMapper.deleteById(id);
    }
}
